<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>制作件在库项目明细表</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" action="/half/reportForms/halInProReportExcel">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label>项目编号</label>
                                    <input type="text" name="ityProCode"
                                           class="form-control" id="ityProCode"
                                           placeholder="请输入项目编号">
                                </div>
                                <div class="form-group">
                                    <label>项目名称</label>
                                    <input type="text" name="ityProName" id="ityProName"
                                           class="form-control"
                                           placeholder="请输入项目名称">
                                </div>
                                <!--<div class="form-group">
                                    <label>日期</label>
                                    <input type="text" class="form-control datepicker"
                                           name="startOdrDate" id="startOdrDate"
                                           readonly="readonly"/>
                                    <span>至</span>
                                    <input type="text" class="form-control datepicker"
                                           name="endOdrDate" id="endOdrDate"
                                           readonly="readonly"/>
                                </div>-->
                                <button type="button" class="btn btn-success" id="btn-search">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="row" id="toolbar">
<!--                    <div class="form-inline">-->
<!--                        <button type="button" id="btn_exportExcel"-->
<!--                                class="btn btn-primary">-->
<!--                            导出-->
<!--                        </button>-->
<!--                    </div>-->
                </div>
                <div class="box-body">
                    <table id="bootstrap-table" style="word-break:break-all; word-wrap:break-all;"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var table;

    /**
     * 设置默认时间
     *
     */
    function getNowMonthDate() {
        var date = new Date();
        var year = date.getFullYear() + "";
        var month = (date.getMonth() + 1) + "";
        var date = date.getDate();
        // 本月第一天日期
        var begin = year + "-" + month + "-1";
        // 本月最后一天日期
        var lastDateOfCurrentMonth = new Date(year,month,0);
        var end = year + "-" + month + "-" + lastDateOfCurrentMonth.getDate();
        // 当日
        var now = year + "-" + month + "-" + date;
        $("#startOdrDate").val(begin);
        $("#endOdrDate").val(now);
    }
    $(function () {
        //getNowMonthDate();
        /**
         * 加载列表
         */
        table = js.table.init({
            url: ctx + "half/reportForms/halInProReportList",
            showColumns: true,
            columns: [
                {
                    title: '序号', field: '', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: '项目编号', field: 'ityProCode'},
                {title: '项目名称', field: 'ityProName'},
                {title: '需方', field: 'demander'},
                {title: '安装地点', field: 'address'},
            ]
        });

        /**
         * 表格搜索
         */
        $("#btn-search").click(function () {
            js.table.search(table);
        });

        /**
         * 导出Excel
         */
        $("#btn_exportExcel").click(function () {

            $("#queryForm").submit();
        });
    });


</script>
</body>
</html>
